<?php
session_start();

// 查询
	//连接数据库	
	include 'conn.php';
    	//获取前端的值
	$id = $_POST['id'];
	$name = $_POST['name'];
	$sex = $_POST['sex'];
	$age = $_POST['age'];
	$phone = $_POST['phone'];


	//SQL语句 查询stuinfo表数据


        if ($name === null) {
            if ($sex === null) {
                if($age===null){
                    if($phone===null){
						if($id===null){

                            
							$sql2 = "SELECT * FROM stuinfo WHERE id = '$id'";

						}else{
							
						}
                    }else{
                        $sql2 = "SELECT * FROM stuinfo WHERE phone_number = '$phone'";

                    }
                }else{
                    $sql2 = "SELECT * FROM stuinfo WHERE age = '$age'";

                  }
            } else{
                $sql2 = "SELECT * FROM stuinfo WHERE sex = '$sex'";
            }
        } else{        
            $sql2 = "SELECT * FROM stuinfo WHERE name='$name'";
        }
		$sql2= "SELECT * FROM stuinfo WHERE age = '18'"; 


		
// header("Location: index2.php?variable=" . $sql2);
exit;
	
?>